package com.pxst.fi.req;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
 * @author rj
 * @create 2023-09-25-15:00
 */
@Data
public class TpiDownloadReq {

    @NotBlank(message = "第三方支付名称不能为空")
    @ApiModelProperty(value = "第三方支付名称", required = true)
    private String driver;

    @NotBlank(message = "下载类型不能为空")
    @ApiModelProperty(value = "下载类型", required = true)
    private String status;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @NotNull(message = "起始时间不能为空")
    @ApiModelProperty(value = "起始时间", required = true)
    private Date startTime;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @NotNull(message = "结束时间不能为空")
    @ApiModelProperty(value = "结束时间", required = true)
    private Date endTime;

    public Map<String, Object> getDateValidated() {
        Map<String, Object> map = new HashMap<>();
        map.put("class", TpiDownloadReq.class.getSimpleName());
        map.put("tradeMin", startTime);
        map.put("tradeMax", endTime);
        return map;
    }
}
